package twoD.IsoPfem;

import java.util.ArrayList;

public class Mesh {

	private ArrayList<Node> nodes_;
	private ArrayList<IEdge> edges_;
	private ArrayList<IFace> faces_;
	private ArrayList<IGeometry> geometries_;

	public Mesh() {
		nodes_ = new ArrayList<Node>();
		edges_ = new ArrayList<IEdge>();
		faces_ = new ArrayList<IFace>();
		geometries_ = new ArrayList<IGeometry>();
	}

	public Node addNode(Node node) {
		nodes_.add(node);
		return node;
	}

	public Node addNode(double... x) {
		Node n = new Node(x);
		nodes_.add(n);
		return n;
	}

	public int getNumberOfNodes() {
		return nodes_.size();
	}

	public Node getNodes(int i) {
		return nodes_.get(i);
	}

	public int getNodeIndex(Node n) {
		return nodes_.indexOf(n);
	}

	public ArrayList<Node> getNodes() {
		return nodes_;
	}

	public Edge addEdge(Edge edge) {
		edges_.add(edge);
		return edge;
	}

	public int getNumberOfEdges() {
		return edges_.size();
	}

	public IEdge getEdges(int i) {
		return edges_.get(i);
	}

	public ArrayList<IEdge> getEdges() {
		return edges_;
	}

	public IFace addFace(IFace face) {
		faces_.add(face);
		return face;
	}

	public int getNumberOfFaces() {
		return faces_.size();
	}

	public IFace getFaces(int i) {
		return faces_.get(i);
	}

	public ArrayList<IFace> getFaces() {
		return faces_;
	}

	public IGeometry addGeometry(IGeometry geom) {
		geometries_.add(geom);
		return geom;
	}

	public int getNumberOfGeometries() {
		return geometries_.size();
	}

	public IGeometry getGeometries(int i) {
		return geometries_.get(i);
	}

	public ArrayList<IGeometry> getGeometries() {
		return geometries_;
	}
}
